package jp.sourceforge.akjrcp.flvtools.basic;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.ffmpeg.FFMpegOptions;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class WMVSettingPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
	public static final String WMV_VIDEO_CODEC="wmvsetting.video";
	public static final String WMV_AUDIO_CODEC="wmvsetting.audio";
	
	public WMVSettingPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("wmvsetting.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		
        addField(new RadioGroupFieldEditor(
        		WMV_VIDEO_CODEC,
				Messages.getString("wmvsetting.video"), // //$NON-NLS-1$
				2,
				new String[][] { 
				{ Messages.getString("wmvsetting.wmv1"), FFMpegOptions.CODEC_VIDEO_WMV1 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("wmvsetting.wmv2"), FFMpegOptions.CODEC_VIDEO_WMV2 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("wmvsetting.msmpeg4v1"), FFMpegOptions.CODEC_VIDEO_MSMPEG4V1 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("wmvsetting.msmpeg4v2"), FFMpegOptions.CODEC_VIDEO_MSMPEG4V2 }, //$NON-NLS-1$ //$NON-NLS-2$
				
			}, getFieldEditorParent()));
        
        addField(new RadioGroupFieldEditor(
        		WMV_AUDIO_CODEC,
				Messages.getString("wmvsetting.audio"), // //$NON-NLS-1$
				2,
				new String[][] { 
				{ Messages.getString("wmvsetting.wmav1"), FFMpegOptions.CODEC_AUDIO_WMA1 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("wmvsetting.wmav2"), FFMpegOptions.CODEC_AUDIO_WMA2 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("wmvsetting.mp3"), FFMpegOptions.CODEC_AUDIO_MP3 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("avisetting.copy"), FFMpegOptions.CODEC_COPY }, //$NON-NLS-1$ //$NON-NLS-2$
				
			}, getFieldEditorParent()));
        
	}

	public void init(IWorkbench workbench) {
		// TODO Auto-generated method stub
		
	}

}
